package cn.com.roy.thread.t3_1_13.pipereaderwriter;


import java.io.*;

public class RunCls {
    public static void main(String[] args) {
        WriteData writeData = new WriteData();
        PipedWriter pipedWriter = new PipedWriter();

        ReadData readData = new ReadData();
        PipedReader pipedReader  = new PipedReader();

        try {
           // outputStream.connect(pipedInputStream);
            pipedReader.connect(pipedWriter);
        } catch (IOException e) {
            e.printStackTrace();
        }



        ThreadRead threadRead = new ThreadRead(readData,pipedReader);
        threadRead.start();

        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        ThreadWrite threadWrite = new ThreadWrite(writeData,pipedWriter);
        threadWrite.start();



    }
}
